package com.nami.gchat.domain.model.co;

import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class GrpInfoModel implements Serializable {

    private static final long serialVersionUID = -144580282083366771L;

    private Long id;

    /**
     * 应用no
     */
    private String appKey;

    /**
     * 群号
     */
    private String groupId;

    /**
     * 群名称
     */
    private String name;

    /**
     * 群头像
     */
    private String groupAvatar;

    /**
     * 群介绍
     */
    private String intro;

    /**
     * 群主
     */
    private String ownerId;

    /**
     * 群公告
     */
    private String noticeMsg;

    /**
     * 是否禁言
     */
    private Boolean banSpeak;

    /**
     * 加群： 10 随意加入 20 认证加入，30 拒绝加入
     */
    private Integer joinType;

    /**
     * 群人数
     */
    private Integer memberCount;

    /**
     * 状态
     */
    private Integer status;

    /**
     * 群类型 10 私有， 20 公开
     */
    private Integer groupType;

    /**
     * 创建时间
     */
    private Date createTime;

    public GrpInfoModel() {
    }

    /**
     * deep clone constructor
     *
     * @param other the Group object to be cloned
     */
    public GrpInfoModel(GrpInfoModel other) {
        this.id = other.getId();
        this.appKey = other.getAppKey();
        this.groupId = other.getGroupId();
        this.name = other.getName();
        this.groupAvatar = other.getGroupAvatar();
        this.intro = other.getIntro();
        this.ownerId = other.getOwnerId();
        this.noticeMsg = other.getNoticeMsg();
        this.banSpeak = other.getBanSpeak();
        this.joinType = other.getJoinType();
        this.memberCount = other.getMemberCount();
        this.status = other.getStatus();
        this.groupType = other.getGroupType();

        if (other.createTime != null) {
            this.createTime = new Date(other.getCreateTime().getTime());

        }

    }

    /**
     * deep clone method
     *
     * @return a new Group object that is a deep copy of this object
     */
    public GrpInfoModel clone() {
        return new GrpInfoModel(this);
    }

}
